package com.atguigu.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * @author 温笙
 * @date 2021/10/24
 */
@Controller
public class ParamController {

    @RequestMapping("/testServletApi")
    //形参位置的request表示当前请求
    public String testServlet(HttpServletRequest request){
        return "param";
    }

    @PostMapping("/testParam")
    public String param(String username,String password,String[] hobby){
        System.out.println(username+" "+password+" "+ Arrays.toString(hobby));
        return "success";
    }
}
